package test.inherit;

public class Student {

//    Student类除了有姓名，还有学号、
//    专业和成绩属性及设置和输出成绩等方法，定义这两个类并用测试类进行测试

    private  String name;
    private int ID;
    private String pro;
    private  double grades;

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", ID=" + ID +
                ", pro='" + pro + '\'' +
                ", grades=" + grades +
                '}';
    }

    public Student(int ID, String pro, double grades) {
        this.ID = ID;
        this.pro = pro;
        this.grades = grades;
    }

    public void setGrades(double grades) {
        this.grades = grades;
    }

    public double getGrades() {
        return grades;
    }
}
